<?php use_stylesheet('/enermaatik/ostukorv.css') ?>
<?php use_javascript('/enermaatik/js/basket.js') ?>
<?php use_javascript('/js/blockUI/script.js') ?>
<?php include_component('headerMenu', 'breadCrumbs') ?>
<script type="text/javascript">
$(document).ready(function() {
    $("input.autocomplete").autocomplete({
		source: [],
		minLength: 0,
		select: function(event, ui){
			var target = $(event.target);
			var dropdown = target.parents('.custom-dropdown');
			dropdown.find('.custom-dropdown-label').html(ui.item.label);
			dropdown.find('input.dropdowninputreal').val(ui.item.key);
			dropdown.trigger('updated');
		}
	}).live('click',function(e){
	}).live('blur',function(){
		$(this).parents('.custom-dropdown').find('.dropdownlabel').show();
		$(this).autocomplete('hide').parents('.dropdowninput').hide();
	});

	$('.dropdownlabel').live('click',function(e){
		var dropdown = $(this).parent();
		$(this).hide();
		$('.dropdowninput',dropdown).show().find('input').focus().trigger('click');
	});
});
</script>
<div class="clear"></div>
<div class="ccontentbox">
<form id="basket_list_form" action="<?php echo LinkGen::getInstance(LinkGen::STRUCTURE_ACTIONS)->link(null, array('module' => 'basketPage', 'action' => 'basketChanged')) ?>" method="post">
	<div class="ccontent">
		<?php include_partial('basketPage/progress', array('node' => $node)) ?>
		<div class="korvsisu">
			<div class="tabel">
				<?php include_partial('basketPage/userBasketListTable', array('products'=>$products)) ?>
				<div class="clear"></div>
			</div>
			<div class="tablekokku">
				<div class="pricetable">
					<div class="pricetablerow">
						<div class="pricetablerowleft">
							<p><?php echo __('Hind') ?></p>
						</div>
						<div class="pricetablerowright">
							<h1><?php echo price_format($subtotalPrice) ?></h1>
							<p><?php echo price_format($subtotalPrice, 'EUR') ?></p>
						</div>
						<div class="clear"></div>

					</div>
					<div class="clear"></div>
					<!-- here was sooduskood  -->
					<div class="clear"></div>
					<?php include_partial('basketPage/transportSelection', array('activeShippingZone' => $activeShippingZone,'shippingZones' => $shippingZones))?>
				</div>

			</div>
			<div class="clear"></div>
		</div>
		<div class="ccontentmainbottom"></div>
		<div class="clear"></div>
		<div class="kokkuhind">
			<?php include_partial('basketPage/userBasketListTotalPayable', array('totalPayable' => $totalPayable)) ?>
			<div class="clear"></div>
		</div>

		<div class="tablebuttons">
			<div class="hallbutton">
				<div class="hallbuttonleft"><img src="/enermaatik/img/tbl.png" width="8" height="26" alt=""/></div>
				<div class="hallbuttoncenter">
					<p><a href="<?php echo __('epoodi_link') ?>"><?php echo __('jätka ostmist') ?></a></p>
				</div>
				<div class="hallbuttonright"><img src="/enermaatik/img/tbr.png" width="8" height="26" alt=""/></div>
				<div class="clear"></div>

			</div>
			<div class="button">
				<div class="buttonleft"><img src="/enermaatik/img/rbleft.png" width="8" height="26" alt=""/></div>
				<div class="buttoncenter">
					<p><a id="submit_button" href="<?php echo LinkGen::getInstance(LinkGen::STRUCTURE_ACTIONS)->link($node['id'], array('module' => 'basketPage', 'action' => 'nextStep', 'step' => 1)) ?>"><?php echo __('vormista ost') ?></a></p>
				</div>
				<div class="buttonright"><img src="/enermaatik/img/rbr.png" width="8" height="26" alt=""/></div>
				<div class="clear"></div>

			</div>
			<div class="clear"></div>
		</div>
	</div>
</form>
</div>

<script type="text/javascript">
	$('#submit_button').click(function(e){
		if($('#zone2').val() == ''){
			e.preventDefault();
			alert('<?php echo __('select shipping zone') ?>');
			return false;
		}

		return true;
	});
</script>